#include<stdio.h>
#define MAX 2147483647
int main(int argc, char const *argv[])
{
    long n,m,re();
    int count=0;
    printf("Enter a number:");
    scanf("%ld",&n);
    printf("The generation process of palindrome : \n");
    while (!nonre((m=re(n))+n))
    {
        if(m+n>=MAX)
        {
            printf("input error,break.\n");
            break;
        }
        else
        {
            printf("[%d]:%ld+%ld=%ld\n",++count,n,m,m+n);
            n+=m;
        }
    }
    printf("[%d]:%ld+%ld=%ld\n",++count,n,m,m+n);
    printf("Here we reached thie aim at last!\n");
    
    return 0;
}
long re(long a)
{
    long t;
    for(t=0;a>0;a/=10)
        t=t*10+a%10;
        return t;
}
int nonre(long s)
{
    if(re(s)==s)
        return 1;
    else
        return 0;
}
